package com.asia5b.a5mall.member.adapter

import android.widget.TextView
import com.asia5b.a5mall.member.R
import com.asia5b.a5mall.middleware.model.member.MessageModel
import com.asia5b.a5mall.middleware.utils.WTimeUtils
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder

class MessageAdapter(list:ArrayList<MessageModel>):
BaseQuickAdapter<MessageModel,BaseViewHolder>(R.layout.item_message_adapter,list){
    override fun convert(helper: BaseViewHolder, item: MessageModel) {
        val tv_message_time = helper.getView<TextView>(R.id.tv_message_time)
        val tv_message_content = helper.getView<TextView>(R.id.tv_message_content)
        val time = WTimeUtils.format("${item.send_time * 1000}", WTimeUtils.text_yyyy_MM_dd_HH_mm_ss)
        tv_message_time.text = time
        tv_message_content.text = item.content
    }
}